import request from '@/utils/request'

// 会员中心首页
export function getMemberInfo(params) {
  return request({
    url: '/UserApi/index',
    method: 'get',
    params
  })
}
// 会员中心更新会员信息
export function sync(data) {
  return request({
    url: '/UserApi/sync',
    method: 'post',
    data
  })
}

// 会员中心 没关注公众号 更新会员信息
export function syncSaveInfo(params) {
  return request({
    url: '/UserApi/save_sync',
    method: 'get',
    params
  })
}

// 登出
export function quit(data) {
  return request({
    url: '/UserApi/quit',
    method: 'get',
    data
  })
}

// 分享优惠券
export function getShareCoupon(params) {
  return request({
    url: '/UserApi/shareCoupon',
    method: 'get',
    params
  })
}

// 我的优惠券页面
export function getMyCoupon(params) {
  return request({
    url: '/UserApi/myCoupon',
    method: 'get',
    params
  })
}
// 通过会员id获取会员昵称
export function UserNickname(data) {
  return request({
    url: '/UserActivityApi/getName',
    method: 'post',
    data
  })
}
// 确定优惠券转赠
export function donationCoupon(data) {
  return request({
    url: '/UserActivityApi/transferCoupon',
    method: 'post',
    data
  })
}
// 转赠记录
export function transferCouponRecords(data) {
  return request({
    url: '/UserActivityApi/transferCouponRecords',
    method: 'post',
    data
  })
}
// 打开大礼包
export function openCouponPack(data) {
  return request({
    url: '/ActivityApi/openCouponPack',
    method: 'post',
    data
  })
}

// 优惠券核销
export function verifyCoupon(data) {
  return request({
    url: '/UserActivityApi/couponverify',
    method: 'post',
    data
  })
}


// 优惠券核销结果
export function verifyCouponResult(data) {
  return request({
    url: '/UserApi/verifyCouponByWeChat',
    method: 'post',
    data
  })
}


// 优惠券兑换中心
export function activityCoupon(params) {
  return request({
    url: '/ActivityApi/coupon',
    method: 'get',
    params
  })
}

// 优惠券兑换
export function exchangeCoupon(data) {
  return request({
    url: '/ActivityApi/couponDo',
    method: 'post',
    data
  })
}
// 领取优惠券页面
export function getCouponConfig(data) {
  return request({
    url: '/SecurityCode/get_coupon_config',
    method: 'post',
    data
  })
}
// 领取优惠券
export function getCoupon(data) {
  return request({
    url: '/SecurityCode/get_coupon',
    method: 'post',
    data
  })
}
// 待评价商品
export function getCommentList(params) {
  return request({
    url: '/UserActivityApi/commentList',
    method: 'get',
    params
  })
}

// 商品评价页面
export function getCommentInfo(params) {
  return request({
    url: '/UserActivityApi/comment',
    method: 'get',
    params
  })
}
// 商品评价操作
export function commentDo(data) {
  return request({
    url: '/UserActivityApi/commentDo',
    method: 'post',
    data
  })
}
// 原价晒单与我要晒单页面
export function getCommentEnjoy(params) {
  return request({
    url: '/UserActivityApi/commentEnjoy',
    method: 'get',
    params
  })
}
// 晒单分享后调用
export function shareCommentEnjoySuccess(params) {
  return request({
    url: '/UserApi/shareCommentEnjoySuccess',
    method: 'get',
    params
  })
}

// 已收藏商品列表
export function getCollectionGoods(params) {
  return request({
    url: '/UserApi/collect',
    method: 'get',
    params
  })
}
// 已收藏商品：取消收藏
export function cancelCollectionGoods(data) {
  return request({
    url: '/ItemApi/cancleCollect',
    method: 'post',
    data
  })
}

// 收藏商品：添加收藏
export function addCollect(data) {
  return request({
    url: '/ItemApi/addCollect',
    method: 'post',
    data
  })
}

// 已收藏店铺
export function getCollectionShop(params) {
  return request({
    url: '/UserActivityApi/collectionSupplier',
    method: 'get',
    params
  })
}
// 已收藏店铺：取消收藏
export function cancelCollectionShop(data) {
  return request({
    url: '/ShopApi/ajaxDelCollectionSupplierShop',
    method: 'post',
    data
  })
}

// 收藏店铺
export function collectSupplierShop(params) {
  return request({
    url: '/ShopApi/ajaxCollectionSupplierShop',
    method: 'get',
    params
  })
}

// 会员余额页面
export function getBalanceTx(params) {
  return request({
    url: '/UserApi/balanceTx',
    method: 'get',
    params
  })
}

// 提现明细、余额变动记录
export function getBalanceTxLog(params) {
  return request({
    url: '/UserApi/balanceTxList',
    method: 'get',
    params
  })
}
// 验证密码
export function checkedPayPassword(data) {
  return request({
    url: '/OrderApi/checkedPayPassword',
    method: 'post',
    data
  })
}
// 提现申请
export function getBalanceDraw(data) {
  return request({
    url: '/UserApi/ajaxBalanceDraw',
    method: 'post',
    data
  })
}
// 取消提现申请
export function cancelTx(data) {
  return request({
    url: '/UserApi/balance_cancel',
    method: 'post',
    data
  })
}
// 企业提现
// 判断企业提现状态
export function getEnterpriseStatus(params = '') {
  return request({
    url: '/UserApi/getEnterpriseStatus',
    method: 'get',
    params
  })
}
// 企业资料上传
export function addEnterpriseAudit(data) {
  return request({
    url: '/UserApi/addEnterpriseAudit',
    method: 'post',
    data
  })
}
// 企业资料编辑
export function editEnterpriseAudit(params = '') {
  return request({
    url: '/UserApi/editEnterpriseAudit',
    method: 'get',
    params
  })
}
// 会员积分页面
export function getPointInfo(params) {
  return request({
    url: '/UserApi/point',
    method: 'get',
    params
  })
}
// 积分转赠操作
export function transferPoint(data) {
  return request({
    url: '/UserApi/transferPoint',
    method: 'post',
    data
  })
}
// 积分兑换红包页面
export function getPointRedInfo(params) {
  return request({
    url: '/UserApi/pointRed',
    method: 'get',
    params
  })
}
// 积分兑换红包操作
export function exchangeRed(data) {
  return request({
    url: '/UserActivityApi/exchangeRed',
    method: 'post',
    data
  })
}
// 积分兑换商品页面
export function getPointExchangeInfo(params) {
  return request({
    url: '/UserApi/pointExchange',
    method: 'get',
    params
  })
}

// 积分兑换商品购物车：列表和增减
export function getPointCart(data) {
  return request({
    url: '/UserApi/pointCartList',
    method: 'post',
    data
  })
}

// 积分兑换商品购物车：删除
export function delPointCart(data) {
  return request({
    url: '/UserApi/deletePoint',
    method: 'post',
    data
  })
}

// 积分兑换商品结算页
export function pointBuy(params) {
  return request({
    url: '/UserApi/pointBuy',
    method: 'get',
    params
  })
}

// 积分兑换商品结算页
export function pointAddOrder(params) {
  return request({
    url: '/UserApi/addOrder',
    method: 'get',
    params
  })
}

// 积分兑换商品订单页面
export function getPointOrderInfo(params) {
  return request({
    url: '/UserApi/pointOrder',
    method: 'get',
    params
  })
}
// 积分兑换商品订单列表
export function getPointOrderList(params) {
  return request({
    url: '/UserApi/pointOrderList',
    method: 'get',
    params
  })
}

// 积分兑换商品订单详情
export function pointExchangeOrderDetail(params) {
  return request({
    url: '/OrderApi/pointExchangeOrderDetail',
    method: 'get',
    params
  })
}

// 积分订单退款
export function applicationSubmission(params) {
  return request({
    url: '/PointExchangeApi/applicationSubmission',
    method: 'get',
    params
  })
}

// 积分兑换商品订单删除订单
export function delPointOrder(data) {
  return request({
    url: '/UserApi/del_order',
    method: 'post',
    data
  })
}

// 积分兑换商品订单付款
export function pointPayUrl(data) {
  return request({
    url: '/UserApi/payUrl',
    method: 'post',
    data
  })
}

// 积分兑换商品订单确认收货
export function pointOrderConfirm(data) {
  return request({
    url: '/UserApi/orderConfirm',
    method: 'post',
    data
  })
}

// 积分排行页面
export function getPointRank(params) {
  return request({
    url: '/UserApi/pointRank',
    method: 'get',
    params
  })
}

// 会员虚拟币页面
export function getVirtualCurrencyInfo(params) {
  return request({
    url: '/UserActivityApi/virtualCurrency',
    method: 'get',
    params
  })
}
// 会员虚拟币排行
export function getVirtualCurrencyRank(params) {
  return request({
    url: '/UserActivityApi/virtualRank',
    method: 'get',
    params
  })
}
// 修改资料
export function getUserData(params) {
  return request({
    url: '/UserApi/changeUserData',
    method: 'get',
    params
  })
}
// 修改资料提交
export function changeUserData(data) {
  return request({
    url: '/UserApi/changeUserDataDo',
    method: 'post',
    data
  })
}
// 重置密码
export function resetPasswordInfo(params) {
  return request({
    url: '/UserApi/retrievePassword',
    method: 'get',
    params
  })
}
// 重置密码提交
export function resetPassword(data) {
  return request({
    url: '/UserApi/retrievePasswordDo',
    method: 'post',
    data
  })
}

// 会员权益
export function getMemberBenefits(params) {
  return request({
    url: '/UserApi/rank',
    method: 'get',
    params
  })
}

// 我的朋友
export function getMyFriend(params) {
  return request({
    url: '/UserApi/myFriend',
    method: 'get',
    params
  })
}

// 我的朋友数据
export function getMyFriendList(params) {
  return request({
    url: '/UserApi/myFriendList',
    method: 'get',
    params
  })
}

// 会员卡
export function getCardDetail(params) {
  return request({
    url: '/UserActivityApi/cardDetail',
    method: 'get',
    params
  })
}
// 领取会员卡
export function receiveCard(params) {
  return request({
    url: '/UserActivityApi/receiveCard',
    method: 'get',
    params
  })
}
// 激活会员卡
export function activationCard(data) {
  return request({
    url: '/UserActivityApi/activationCard',
    method: 'post',
    data
  })
}
// 扫码领取微信会员卡
export function scanQrcodeCard(params) {
  return request({
    url: '/UserActivityApi/scanQrcodeCard',
    method: 'get',
    params
  })
}
// 删除会员卡
export function delCard(data) {
  return request({
    url: '/UserActivityApi/delCard',
    method: 'post',
    data
  })
}

/**
 * 会员卡列表
 * @param {Object} params parameters
 */
export function reqGetCards(params) {
  return request({
    url: '/UserActivityApi/cardList',
    method: 'get',
    params
  })
}
/**
 * 创建会员卡订单
 * @param {*} data parameters
 */
export function reqPostCardOrder(data) {
  return request({
    url: '/UserActivityApi/addCardOrder',
    method: 'post',
    data
  })
}
/**
 * 会员卡订单购买
 * @param {*} data parameters
 */
export function reqPostCardOrderPay(data) {
  return request({
    url: '/UserActivityApi/buyCard',
    method: 'post',
    data
  })
}
/**
 * 查看会员卡交易记录
 * @param {*} data parameters
 */
export function reqGetCardTradeInfo(params) {
  return request({
    url: '/UserActivityApi/cardTradeInfo',
    method: 'get',
    params
  })
}
/**
 * 会员卡订单购买
 * @param {*} data parameters
 */
export function reqPostCardOrderRefund(data) {
  return request({
    url: '/UserActivityApi/refundCard',
    method: 'post',
    data
  })
}

/* // 会员卡领取成功页面
export function getReceiveCard(params) {
  return request({
    url: '/UserActivityApi/cardDetail',
    method: 'get',
    params
  })
} */

// 会员中心我的上级
export function getUserSupplier(params) {
  return request({
    url: '/UserActivityApi/userSupplier',
    method: 'get',
    params
  })
}

// 签到页面
export function getCheckinInfo(params) {
  return request({
    url: '/ActivityApi/checkin',
    method: 'get',
    params
  })
}

// 签到操作
export function checkinDo(data) {
  return request({
    url: '/ActivityApi/checkinDo',
    method: 'post',
    data
  })
}

// 充值记录
export function rechargeList(params) {
  return request({
    url: '/UserApi/rechargeList',
    method: 'post',
    params
  })
}

// 账户充值
export function balanceRecharge(data) {
  return request({
    url: '/UserApi/balanceRecharge',
    method: 'post',
    data
  })
}

// 购物卡充值
export function shoppingCardRecharge(data) {
  return request({
    url: '/UserApi/shoppingCardRecharge',
    method: 'post',
    data
  })
}

// 充值方式
export function payType(params) {
  return request({
    url: '/UserServiceApi/payType',
    method: 'get',
    params
  })
}

// 试用订单列表
export function getTryList(params) {
  return request({
    url: '/UserServiceApi/tryList',
    method: 'get',
    params
  })
}

// 试用订单确认收货
export function tryOrderConfirm(params) {
  return request({
    url: '/UserServiceApi/tryOrderConfirm',
    method: 'get',
    params
  })
}

// 试用订单再次付款
export function buyAgain(params) {
  return request({
    url: '/UserServiceApi/tryPay',
    method: 'post',
    params
  })
}

// 试用订单详情
export function getTryListDetail(params) {
  return request({
    url: '/UserServiceApi/tryListDetail',
    method: 'get',
    params
  })
}

// 余额转赠
export function transferBalance(data) {
  return request({
    url: '/UserServiceApi/transferBalance',
    method: 'post',
    data
  })
}

// 余额转赠验证会员信息
export function getUserBasicInfo(data) {
  return request({
    url: '/UserApi/getUserBasicInfo',
    method: 'post',
    data
  })
}

// 试用报告数据
export function tryComment(params) {
  return request({
    url: '/OrderApi/tryComment',
    method: 'get',
    params
  })
}

// 试用报告提交评价
export function tryCommentDo(params) {
  return request({
    url: '/OrderApi/tryCommentDo',
    method: 'post',
    params
  })
}

// 会员中心公共导航数据
export function publicCenterParam(params) {
  return request({
    url: '/UserServiceApi/publicCenterParam',
    method: 'post',
    params
  })
}

// 试用报告提交评价
export function dlsUpgradeCondition(params) {
  return request({
    url: '/UserApi/dlsUpgradeCondition',
    method: 'get',
    params
  })
}

// 站内信
export function uptMsgInfo(params) {
  return request({
    url: '/UserApi/uptMsgInfo',
    method: 'get',
    params
  })
}

// 获取是否有多个userId
export function getUsers() {
  return request({
    url: '/dz/getDeejUserByMobile',
    method: 'get'
  })
}

// 切换userId
export function editUsers(data) {
  return request({
    url: '/dz/deejChangeUser',
    method: 'post',
    data
  })
}

/**
 * 服务列表
 * @param {*} data param
 */
export function reqPostServiceOrderList(data) {
  return request({
    url: '/OrderApi/serviceOrderList',
    method: 'post',
    data
  })
}

/**
 * 确认服务
 * @param {*} data param
 */
export function reqPostServiceConfirm(data) {
  return request({
    url: '/OrderApi/serviceConfirm',
    method: 'post',
    data
  })
}

// 我的课程
export function myCourses(params) {
  return request({
    url: '/OnlineCourseApi/myCourses',
    method: 'get',
    params
  })
}

// 通联分账签约页面
export function tlGetMember(params) {
  return request({
    url: '/TonglianApi/getMember',
    method: 'get',
    params
  })
}
// 通联分账获取短信验证码
export function sendVerificationCode(data) {
  return request({
    url: '/TonglianApi/sendVerificationCode',
    method: 'post',
    data
  })
}
// 通联分账签约操作
export function personSignContract(data) {
  return request({
    url: '/TonglianApi/personSignContract',
    method: 'post',
    data
  })
}

// 获取通联分账签约跳转
export function signContract(data) {
  return request({
    url: '/TonglianApi/signContract',
    method: 'post',
    data
  })
}

// 通联分账5.2.8确认支付（后台+短信验证码确认）
export function payByBackSMS(data) {
  return request({
    url: '/TonglianApi/payByBackSMS',
    method: 'post',
    data
  })
}

// 获取手机号
export function decriptPhone(data) {
  return request({
    url: '/PassportApi/get_phone_number',
    // url: '/PassportApi/decriptPhone',      
    method: 'post',
    data
  })
}

// 保存手机号
export function savePhone(data) {
  return request({
    url: '/PassportApi/savePhone',
    method: 'post',
    data
  })
}
// 通联分账企业提现
export function companyPayByBackSMS(data) {
  return request({
    url: '/UserApi/companyPayByBackSMS',
    method: 'post',
    data
  })
}
// 通联分账企业提现--供应商
export function gysCompanyPayByBackSMS(data) {
  return request({
    url: '/UserActivityApi/companyPayByBackSMS',
    method: 'post',
    data
  })
}
// 通联余额支付 修改手机号 发送验证码
export function bankCardChangeBindPhone(data) {
  return request({
    url: '/TonglianApi/bankCardChangeBindPhone',
    method: 'post',
    data
  })
}
// 通联余额支付 修改手机号 发送验证码  后 确定提交
export function verifyBankCardChangeBindPhone(data) {
  return request({
    url: '/TonglianApi/verifyBankCardChangeBindPhone',
    method: 'post',
    data
  })
}
// 绑定手机号
export function tongLianBindPhone(data) {
  return request({
    url: '/TonglianApi/bindPhone',
    method: 'post',
    data
  })
}
export function signCompanyContract(data) {
  return request({
    url: '/TonglianApi/setCompanyInfo',
    method: 'post',
    data
  })
}
// 信息采集
export function tongLianIdCardCollect(data) {
  return request({
    url: '/TonglianApi/idcardCollect',
    method: 'post',
    data
  })
}
// 余额转到通联余额
export function setBalanceTurnBalanceTl(data) {
  return request({
    url: '/UserApi/tlfzBalanceToDeposit',
    method: 'post',
    data
  })
}
// 供应商余额转到通联余额
export function setGysBalanceTurnBalanceTl(data) {
  return request({
    url: '/UserActivityApi/tlSupplierAmountDeposit',
    method: 'post',
    data
  })
}
// 个人信息 上传头像和昵称
export function saveInformation(data) {
  return request({
    url: '/UserInfo/save',
    method: 'post',
    data
  })
}